<%@ page language="java" contentType="text/html; charset=Utf-8"
    pageEncoding="Utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
%>    
  <div class="showtxt5" id="announce">系统公告：</div>
        <div class="showtxt6">
        	<div class="wrap_left">
        		<img width="60" height="60" src='<s:property value="#session.user.photoUrl" />' />
            </div>
        	<div class="wrap_left">
            	<div class="my02">
            	<span class="span10"><s:property value="#session.user.nickName" /></span><br />
				<span class="span13">信用等级：<img src="<%=path %>/images/star_s<s:property value='#session.user.star' />.gif" /><br />
				 您当前的的平台服务费率是：
				 <s:if test="#session.rate!=0"><s:property value="#session.rate" />%</s:if><s:else>20%</s:else>&nbsp;&nbsp;&nbsp;&nbsp;<a href="<%=path%>/help/help.jsp?id=4&item=5">什么是平台服务费?</a><br />
				<a href="<%=path %>/initShopinfo.htm">发布代购信息<span id="canBuyNum">0</span> 条</a>&nbsp;&nbsp;|&nbsp;&nbsp; <a href="<%=path %>/initInviteinfo.htm">发布邀约<span id="inviteNum">0</span> 条</a></span>
                </div>
            </div>
        </div>
        <div class="clear"></div>
      <div class="my03"><a href="<%=path%>/initagent.htm?read=0">新消息</a>( <span id="messageNum" style="color:#C00;">0</span>) &nbsp;&nbsp;|&nbsp;&nbsp; <a href="<%=path %>/initTradingInfo.htm?state=1">待发货</a>( <span id="deliveryNum"  style="color:#C00;">0</span> )&nbsp;&nbsp;|&nbsp;&nbsp;<a href="<%=path %>/initTradedInfo.htm?userEvaluation=1">待评价</a>( <span id="evaluateNum"  style="color:#C00;">0</span> ) </div>
<script type="text/javascript">
$(document).ready(function() {
	getCanBuyNum();
	getInviteNum();
	getMessageNum();
	groupTransInfo();
	queryAnnounce();
});

function queryAnnounce() {
	$.ajax({
		url:'queryAnnounce.htm',
		type:'get',
		data:{"rand":Math.random()},
		async:true,
		success:function(json) {
			$("#announce").append(json.am.content);
		}
	});
}

function getCanBuyNum() {
	$.ajax({
		url:'countCanBuys.htm',
		type:'get',
		data:{"rand":Math.random()},
		async:true,
		success:function(json) {
			$("#canBuyNum").html(json.canBuyNum);
		}
	});
}

function getInviteNum() {
	$.ajax({
		url:'countInvites.htm',
		type:'get',
		data:{"rand":Math.random()},
		async:true,
		success:function(json) {
			$("#inviteNum").html(json.inviteNum);
		}
	});
}

function getMessageNum() {
	$.ajax({
		url:'countMessagesByBroker.htm',
		type:'get',
		data:{"rand":Math.random()},
		async:true,
		success:function(json) {
			$("#messageNum").html(json.messageNum);
			if (json.messageNum == 0) {
				$("#sm").html("");
			}
			else {
				$("#smCount2").html(json.messageNum);	
			}
			
		}
	});
}

function groupTransInfo() {
	$.ajax({
		url:'groupTransInfo.htm',
		type:'get',
		data:{"rand":Math.random()},
		async:true,
		success:function(json) {
			$("#deliveryNum").html(json.deliveryNum);
			$("#evaluateNum").html(json.evaluateNum);
		}
	});
}


 </script>